Skip to content

Comments

12 19 add mcp server#221

Closed
thestumonkey wants to merge 19 commits intoSimpleOpenSoftware:devfrom
Ushadow-io:12-19-add-mcp-server
Closed

12 19 add mcp server#221
thestumonkey wants to merge 19 commits intoSimpleOpenSoftware:devfrom
Ushadow-io:12-19-add-mcp-server

Conversation

@thestumonkey
Copy link
Contributor

@thestumonkey thestumonkey commented Dec 20, 2025

Summary by CodeRabbit

Release Notes

  • New Features

    • Settings management interface for configurable application features
    • API key management system with key generation and revocation
    • MCP server enabling conversation access and audio resource retrieval
    • Graceful support for optional/missing service credentials
    • Audio recording interface with waveform visualization
  • UI/UX

    • New Settings page with organized configuration categories
    • Redesigned login and improved chat/conversation interfaces
    • Dark mode support and consistent styling updates
    • Enhanced header with user menu and recording controls
  • Infrastructure

    • Modularized Docker Compose configuration for flexible deployment
    • Improved multi-environment orchestration and support

✏️ Tip: You can customize this high-level summary in your review settings.

AnkushMalaker and others added 19 commits December 19, 2025 00:40
Updated project title to indicate it's a fork.
# Conflicts:
#	backends/advanced/webui/src/pages/Settings.tsx
#	backends/advanced/webui/src/services/api.ts
# Conflicts:
#	README-K8S.md
#	backends/advanced/src/advanced_omi_backend/auth.py
#	backends/advanced/src/advanced_omi_backend/services/mycelia_sync.py
#	backends/advanced/webui/package-lock.json
#	backends/advanced/webui/package.json
#	quickstart.md
#	tests/infrastructure/infra_tests.robot
#	tests/integration/websocket_streaming_tests.robot

# Conflicts:
#	README.md
#	app/app.json
#	backends/advanced/src/advanced_omi_backend/app_config.py
#	backends/advanced/src/advanced_omi_backend/auth.py
#	backends/advanced/src/advanced_omi_backend/controllers/system_controller.py
#	backends/advanced/src/advanced_omi_backend/database.py
#	backends/advanced/src/advanced_omi_backend/models/job.py
#	backends/advanced/src/advanced_omi_backend/routers/modules/health_routes.py
#	backends/advanced/src/advanced_omi_backend/services/memory/config.py
#	backends/advanced/src/advanced_omi_backend/services/memory/service_factory.py
#	backends/advanced/src/advanced_omi_backend/services/mycelia_sync.py
#	backends/advanced/webui/src/pages/System.tsx
#	tests/infrastructure/infra_tests.robot
#	tests/resources/transcript_verification.robot
#	tests/setup/test_env.py
@thestumonkey
Copy link
Contributor Author

  • [ ]

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 20, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

This PR rebrands the project from Chronicle to Friend-Lite, restructures Docker Compose services into modular files, introduces comprehensive application settings management with MongoDB persistence and caching, implements MCP server functionality for conversation access, adds API key lifecycle endpoints, and significantly enhances the frontend with a new Settings page, responsive layout redesign, and dark mode support.

Changes

Cohort / File(s) Summary
Rebranding & Configuration
.env.secrets.template, .gitignore, Makefile, README.md, config-defaults.yml, scripts/generate-k8s-configs.py
Systematic rebranding from Chronicle to Friend-Lite; updated project naming, namespace defaults, and K8s manifest generation; expanded .gitignore with new secret/config patterns; new config defaults template with comprehensive system settings.
Docker Compose & Infrastructure
backends/advanced/compose/backend.yml, backends/advanced/compose/frontend.yml, backends/advanced/docker-compose.yml, docker-compose.yml, docker-compose.infra.yml, compose/infrastructure-shared.yml, backends/advanced/Caddyfile.template, caddy/Caddyfile
Restructured Docker Compose from monolithic to modular includes; separated backend/frontend/infrastructure services; added shared chronicle-network and ollama_data volume; added MCP proxy route in Caddyfile; introduced infrastructure-shared.yml for MongoDB, Redis, Qdrant, Neo4j, Caddy.
Settings Management System
backends/advanced/src/advanced_omi_backend/settings_manager.py, backends/advanced/src/advanced_omi_backend/settings_models.py, backends/advanced/src/advanced_omi_backend/utils/api_keys_manager.py
New SettingsManager class with MongoDB persistence, TTL-based caching, and singleton pattern; comprehensive Pydantic models for all settings categories; API keys file I/O with masking and template-aware writing.
Graceful Degradation & Configuration
backends/advanced/src/advanced_omi_backend/app_config.py, backends/advanced/src/advanced_omi_backend/services/memory/config.py, backends/advanced/src/advanced_omi_backend/services/memory/service_factory.py, backends/advanced/src/advanced_omi_backend/services/transcription/__init__.py
Added allow_missing_api_keys flag throughout; transcription and LLM features now support optional/disabled states; memory config respects graceful degradation for missing OpenAI keys.
API Routes & Endpoints
backends/advanced/src/advanced_omi_backend/routers/api_router.py, backends/advanced/src/advanced_omi_backend/routers/modules/__init__.py, backends/advanced/src/advanced_omi_backend/routers/modules/settings_routes.py, backends/advanced/src/advanced_omi_backend/routers/modules/system_routes.py, backends/advanced/src/advanced_omi_backend/routers/modules/user_routes.py
New settings_routes with 20+ endpoints for settings CRUD per category; API key generation/revocation in user_routes; configuration status endpoint in system_routes; integrated into main API router.
MCP Server & Health Checks
backends/advanced/src/advanced_omi_backend/services/mcp_server.py, backends/advanced/src/advanced_omi_backend/app_factory.py, backends/advanced/src/advanced_omi_backend/controllers/system_controller.py, backends/advanced/src/advanced_omi_backend/routers/modules/health_routes.py
New MCP server module with conversation/audio resource access, user identity resolution, SSE transport, and base64 audio encoding; integrated into app startup; health checks now include URL fields and support graceful degradation.
User Model Extensions
backends/advanced/src/advanced_omi_backend/models/user.py
Added api_key and api_key_created_at optional fields to User and UserRead models.
Frontend Settings & Configuration Pages
backends/advanced/webui/src/pages/Settings.tsx, backends/advanced/webui/src/pages/System.tsx
New comprehensive Settings page with multi-tab UI (Core Infra, API Keys, MCP Key, Memory, LLM, Speech, Conversations); System page extended with API key configuration and infrastructure status display.
Frontend Layout & Navigation
backends/advanced/webui/src/components/layout/Layout.tsx, backends/advanced/webui/src/components/header/HeaderRecordButton.tsx, backends/advanced/webui/src/App.tsx
Major layout redesign with sticky header, user menu, search bar, responsive navigation; new HeaderRecordButton with waveform visualization; Settings page routed and integrated.
Frontend Pages Styling & Theming
backends/advanced/webui/src/pages/Chat.tsx, backends/advanced/webui/src/pages/Conversations.tsx, backends/advanced/webui/src/pages/ConversationsRouter.tsx, backends/advanced/webui/src/pages/ConversationsTimeline.tsx, backends/advanced/webui/src/pages/LiveRecord.tsx, backends/advanced/webui/src/pages/LoginPage.tsx, backends/advanced/webui/src/pages/Queue.tsx
Extensive color scheme updates from gray to neutral palettes; dark mode support across all pages; redesigned LoginPage with health checks and improved UX; tab navigation refactored for Conversations/Timeline; loading and error states enhanced.
Frontend Context & Styling
backends/advanced/webui/src/contexts/AuthContext.tsx, backends/advanced/webui/src/contexts/ThemeContext.tsx, backends/advanced/webui/src/index.css, backends/advanced/webui/tailwind.config.js
Added api_key fields to User context; default theme changed to dark mode; comprehensive index.css with component and utility layers; Tailwind config extended with color palettes, typography, shadows, and animations.
Frontend API Client
backends/advanced/webui/src/services/api.ts
Extensive API expansion: systemApi methods for configuration/API keys; settingsApi with 25+ endpoints for all settings categories and cache invalidation; speakerApi formatting adjustments.
Build & Dependencies
backends/advanced/webui/Dockerfile, backends/advanced/webui/package.json
Node.js base updated to 22-alpine; npm install switched to --legacy-peer-deps; VITE_BASE_PATH build arg added; sass-embedded downgraded to ^1.80.7.
Utilities & Tests
quick-start.sh, tests/setup/test_env.py, tests/infrastructure/infra_tests.robot
New quick-start.sh bootstrap script with admin setup, config generation, infrastructure startup, and Tailscale HTTPS detection; test_env.py refactored to use python-dotenv and expose comprehensive configuration constants; minor teardown formatting in infra_tests.robot.

Sequence Diagrams

sequenceDiagram
    participant Client as Frontend
    participant API as Backend API
    participant Auth as Auth Handler
    participant MCP as MCP Server
    participant DB as MongoDB
    participant AudioFS as Audio FileSystem

    Client->>Auth: GET /mcp/sse (Bearer token)
    Auth->>Auth: Extract & validate token
    Auth->>Client: Upgrade to SSE
    
    Client->>MCP: POST /mcp/messages (list_conversations)
    MCP->>Auth: Resolve user from token
    Auth->>DB: Lookup user.id
    DB-->>Auth: user.id
    MCP->>DB: Query conversations (user_id, filters)
    DB-->>MCP: Conversations array
    MCP->>Client: SSE: Return JSON (conversations + pagination)
    
    Client->>MCP: POST /mcp/messages (get_conversation)
    MCP->>DB: Fetch conversation by id
    DB-->>MCP: Conversation with transcripts
    MCP->>Client: SSE: Return formatted conversation
    
    Client->>MCP: POST /mcp/messages (get_conversation_audio)
    MCP->>AudioFS: Read audio file
    AudioFS-->>MCP: Binary audio
    MCP->>MCP: Base64 encode
    MCP->>Client: SSE: Return {path, size, mime, base64}
Loading
sequenceDiagram
    participant Client as Frontend
    participant API as Settings API
    participant Cache as In-Memory Cache
    participant DB as MongoDB
    participant Env as Environment

    Client->>API: GET /api/settings/speech-detection
    API->>Cache: Check cache hit (TTL=5s)
    alt Cache miss
        API->>DB: Query speech_detection document
        DB-->>API: Document or defaults
        API->>Cache: Store with TTL
    end
    Cache-->>API: Settings
    API-->>Client: Return SpeechDetectionSettings

    Client->>API: PUT /api/settings/speech-detection (updated values)
    API->>DB: Update document + timestamp
    DB-->>API: Success
    API->>Cache: Invalidate key
    API-->>Client: Return updated settings

    Client->>API: POST /api/settings/invalidate-cache?category=speech-detection
    API->>Cache: Clear category
    Cache-->>API: Done
    API-->>Client: {status: success}
Loading
sequenceDiagram
    participant User as User
    participant UI as Settings Page
    participant API as Backend API
    participant DB as MongoDB
    participant FS as Filesystem

    User->>UI: Click "Generate API Key"
    UI->>API: POST /me/api-key
    API->>API: Generate 32-char secret
    API->>API: Set created_at to UTC now
    API->>DB: Update user.api_key & api_key_created_at
    DB-->>API: Success
    API->>UI: Return {api_key, created_at}
    UI->>UI: Display key + copy button

    User->>UI: Click "Save API Keys to File"
    UI->>UI: Validate non-empty keys
    UI->>API: POST /api/settings/api-keys/save (keys, save_to_file=true)
    API->>FS: Check if .env.api-keys.template exists
    alt Template exists
        API->>FS: Read template
        API->>FS: Substitute key placeholders
        API->>FS: Write .env.api-keys
    else No template
        API->>FS: Write simple key=value format
    end
    API->>DB: Update ApiKeysSettings if save_to_database=true
    DB-->>API: Success
    API->>UI: Return {status, saved_to_file, saved_to_database}
    UI->>User: Show success message
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Areas requiring extra attention:

  • MCP Server Implementation (backends/advanced/src/advanced_omi_backend/services/mcp_server.py) — New MCP integration with user identity resolution, conversation queries, base64 audio encoding, and SSE transport; verify auth boundary and data access controls.
  • Settings Manager & Caching (backends/advanced/src/advanced_omi_backend/settings_manager.py) — Singleton pattern, TTL-based cache, MongoDB persistence, and initialization guard; ensure thread-safety and cache invalidation correctness.
  • Docker Compose Restructuring (docker-compose.yml, backends/advanced/docker-compose.yml, compose/infrastructure-shared.yml) — Modular includes, external network definition, volume declarations; verify network connectivity and service dependencies are correctly wired.
  • Frontend Settings Page (backends/advanced/webui/src/pages/Settings.tsx) — Large component with complex state management, multiple API integrations, and tab navigation; verify form validation, error handling, and API error recovery.
  • Health Routes Refactoring (backends/advanced/src/advanced_omi_backend/routers/modules/health_routes.py) — Extensive provider health logic with graceful degradation, URL field additions, and memory provider branching; ensure all paths are covered and memory provider selections work correctly.
  • API Routes & Access Control (backends/advanced/src/advanced_omi_backend/routers/modules/settings_routes.py) — 20+ new endpoints with mixed access control (read: current_active_user, write: current_superuser); verify permissions are consistently applied.
  • Layout Redesign (backends/advanced/webui/src/components/layout/Layout.tsx) — Major structural overhaul affecting multiple page layouts; test responsive behavior and ensure all navigation paths still function.

Possibly related PRs

  • chronicler-ai/chronicle#69 — Implements OpenMemory MCP integration with overlapping memory service/providers and MCP client/service code.
  • chronicler-ai/chronicle#144 — Modifies health_routes.py transcription provider initialization and health output fields with similar graceful degradation patterns.
  • chronicler-ai/chronicle#174 — Makes overlapping rebranding and config changes (Makefile, backend naming, K8s scripts).

Suggested reviewers

  • AnkushMalaker
  • 0xrushi

🐇 Hop hop, a friend-lite rebrand takes flight!
Settings dance with MongoDB's might,
MCP opens conversation's door,
While layout springs with style once more!

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2e79b70 and fc4ed63.

⛔ Files ignored due to path filters (1)
  • backends/advanced/webui/package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (53)
  • .env.secrets.template (1 hunks)
  • .gitignore (3 hunks)
  • Makefile (13 hunks)
  • README.md (1 hunks)
  • backends/advanced/Caddyfile.template (2 hunks)
  • backends/advanced/compose/backend.yml (1 hunks)
  • backends/advanced/compose/frontend.yml (1 hunks)
  • backends/advanced/docker-compose.yml (1 hunks)
  • backends/advanced/src/advanced_omi_backend/app_config.py (3 hunks)
  • backends/advanced/src/advanced_omi_backend/app_factory.py (3 hunks)
  • backends/advanced/src/advanced_omi_backend/controllers/system_controller.py (1 hunks)
  • backends/advanced/src/advanced_omi_backend/models/user.py (2 hunks)
  • backends/advanced/src/advanced_omi_backend/routers/api_router.py (2 hunks)
  • backends/advanced/src/advanced_omi_backend/routers/modules/__init__.py (3 hunks)
  • backends/advanced/src/advanced_omi_backend/routers/modules/health_routes.py (14 hunks)
  • backends/advanced/src/advanced_omi_backend/routers/modules/settings_routes.py (1 hunks)
  • backends/advanced/src/advanced_omi_backend/routers/modules/system_routes.py (1 hunks)
  • backends/advanced/src/advanced_omi_backend/routers/modules/user_routes.py (2 hunks)
  • backends/advanced/src/advanced_omi_backend/services/mcp_server.py (1 hunks)
  • backends/advanced/src/advanced_omi_backend/services/memory/config.py (2 hunks)
  • backends/advanced/src/advanced_omi_backend/services/memory/service_factory.py (2 hunks)
  • backends/advanced/src/advanced_omi_backend/services/transcription/__init__.py (5 hunks)
  • backends/advanced/src/advanced_omi_backend/settings_manager.py (1 hunks)
  • backends/advanced/src/advanced_omi_backend/settings_models.py (1 hunks)
  • backends/advanced/src/advanced_omi_backend/utils/api_keys_manager.py (1 hunks)
  • backends/advanced/webui/Dockerfile (2 hunks)
  • backends/advanced/webui/package.json (1 hunks)
  • backends/advanced/webui/src/App.tsx (2 hunks)
  • backends/advanced/webui/src/components/header/HeaderRecordButton.tsx (1 hunks)
  • backends/advanced/webui/src/components/layout/Layout.tsx (2 hunks)
  • backends/advanced/webui/src/contexts/AuthContext.tsx (1 hunks)
  • backends/advanced/webui/src/contexts/ThemeContext.tsx (1 hunks)
  • backends/advanced/webui/src/index.css (1 hunks)
  • backends/advanced/webui/src/pages/Chat.tsx (5 hunks)
  • backends/advanced/webui/src/pages/Conversations.tsx (3 hunks)
  • backends/advanced/webui/src/pages/ConversationsRouter.tsx (1 hunks)
  • backends/advanced/webui/src/pages/ConversationsTimeline.tsx (2 hunks)
  • backends/advanced/webui/src/pages/LiveRecord.tsx (3 hunks)
  • backends/advanced/webui/src/pages/LoginPage.tsx (3 hunks)
  • backends/advanced/webui/src/pages/Queue.tsx (46 hunks)
  • backends/advanced/webui/src/pages/Settings.tsx (1 hunks)
  • backends/advanced/webui/src/pages/System.tsx (6 hunks)
  • backends/advanced/webui/src/services/api.ts (2 hunks)
  • backends/advanced/webui/tailwind.config.js (1 hunks)
  • caddy/Caddyfile (1 hunks)
  • compose/infrastructure-shared.yml (1 hunks)
  • config-defaults.yml (1 hunks)
  • docker-compose.infra.yml (1 hunks)
  • docker-compose.yml (1 hunks)
  • quick-start.sh (1 hunks)
  • scripts/generate-k8s-configs.py (1 hunks)
  • tests/infrastructure/infra_tests.robot (1 hunks)
  • tests/setup/test_env.py (1 hunks)

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants